rewrote sprite function to properly display sprites with any combination of position, offset, and crop
clean up code and remove debug statements