implemented more helper functions, fixed bugs in existing ones