Small improvements

Hello. I've made some code improvements largely for better readability. And fixed "background freeze" bug when "ypos" parameter not specified. And have fixed "freezing of background" when "ypos" not specified.