restricting zoom in and out level
cleanup code a little. removed unneccesary code and replaced parent.parent type of code