updated to work in 5.1 and 6.0 better
1