All function done

Working but cleaning all stuff remaining