#28 some minor changes, trying to make it work more neatly