major refactor of code; added data hiding; updated tests