make variables relative to screensize and move unnecessary work out of render method