This is version 2 for same changes but with less clutter