Fixed edit, previous command features. Added comments.