RM, CP AND GREP. GREP IS A DIRECT COPY, NEEDS TO BE REWRITTEN, SOURCE IS PROVIDED IN COMMENTS