semi working mode function added
finished mode function