added small optimalization in sprite