Previous three merge requests

This is a merge request that combines #31, #32, #33 - with conflicts solved