Some progress. Still debugging