code updated to recent hardware changes