all working, comments added on how to improve when time allows