cleaned up and added python code for ic control