#77 basic implementation, not all unit tests done yet