Implements various improvments and closes #5.