getting sprite rectangles and minor function changes
as previous