First working function in tuby.. still buggy