still trying to fix nested fn calls