more complete working