prev next working properly, other fixes