A new three-dimensional code for free-electron laser simulation has been developed. The code allows for a three-dimensional treatment of electron dynamics and the radiation field. It also includes space-charge, wiggler tapering and errors. and external focussing of the electron beam with either a quadrupole FODO lattice of ion channel. Simulation results for a microwiggler FEL are presented. Ion channel focussing is found to bring about significant enhancements in gain.