get function now working
fixed crash len<2 bug