Added working prev functionality