should be working, tho seems to return wrong values (sometimes?)