working but needs to be cleaned up