finished phase 1 implementation