moving sprite code around