Updated to use program memory