Closes #29, Closes #30, Closes #3. Added new functions.