working now correctly