add sprite sheet algorithm