Modified to use wrapper function for GPIO