adds minimum to work. Time to refactor