fixe bug, cleaned up