Needed corrections to my code