assignment done

have attempted to write both functions