beginning of ast implementation