improvement in the implmentation of friction

Signed-off-by: Aniket Anvit <seeanvit@gmail.com>