Cleaned up method to define canvas size