cleaned up existing code