added phase 1, minor bug fixes