add Rectangle class + some small improvements