minor improvements and some basic testing. First attempt to integrade markings