refactored jquery commands

fixes canvas sizing issue