Cleaned up, added convenience constructor, documentation, made code nicer