relative width support

added support for relative (x%) canvases
additional comments
if..else -> switch in main loop