major changes, cleanup needed