l000 logic implementet but still buggy