partially fixes #27
finishes fixing #27