Implemented a bit more complex line drawing functionality (partially)