Renamed subroutines to magal.