program mostly working