minor chages, working