cleaning up, added malik's changes