fixed small bugs, added dynamic canvas resize