Cleaned up code and improved device detection
Added folder selection