Reorganized code, added edge detection kernel