Added some more logic to placing of sprites.