# Debugging help U5L4

**URL:** https://forum.code.org/t/debugging-help-u5l4/33858
**Category:** CS Principles
**Tags:** csp-unit-5
**Created:** [December 8, 2020, 7:30pm UTC](https://forum.code.org/t/debugging-help-u5l4/33858 "2020-12-08T19:30:06Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jlegatt](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@jlegatt](https://forum.code.org/u/jlegatt)
#### Post date: [December 8, 2020, 7:30pm UTC](https://forum.code.org/t/debugging-help-u5l4/33858/1 "2020-12-08T19:30:06Z")

</div>

Unit 5 lesson 4, a student made code and it doesn’t work and I can’t figure out what the bug is. Feedback appreciated. [https://studio.code.org/projects/applab/LtAu6jjIzLjL\_KzJB3yNAVuMTTQLXUGfUcsE1UMguSk](https://studio.code.org/projects/applab/LtAu6jjIzLjL_KzJB3yNAVuMTTQLXUGfUcsE1UMguSk)

Thank you!

---

<div class="post-metadata">

### Author: ![terence.stone25](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/terence.stone25/32/5124_2.png) [@terence.stone25](https://forum.code.org/u/terence.stone25)
#### Post date: [December 8, 2020, 8:21pm UTC](https://forum.code.org/t/debugging-help-u5l4/33858/2 "2020-12-08T20:21:48Z")

</div>

@jlegatt Thanks for posting this request. Finding bugs can be a frustrating experience at times. However, your teacher account has access to an example solution on the right side of your screen. Please see the image below.

 ![Screen Shot 2020-12-08 at 3.02.43 PM](https://us1.discourse-cdn.com/flex016/uploads/codeorgforum/original/2X/d/d8c1730822e036de66ae339048131808123c9713.png)

Looking at the _ **Example Solution** _, you will see that your student has a number of logical errors in each of the onEvent functions.  
The _leftButton_ onEvent function needs the least changes (one).  
The _rightButton_ onEvent needs two adjustments.  
The _updateScreen_ function needs a number of changes that will allow it to work appropriately.  
Please also encourage your student to use comments to help with code organization.

I hope the solution helps with the debugging process. Please let us know if you need further assistance.
