Started rewriting amot in python