added in assertions for initialize. added unittest